import java.util.Scanner;

public class homeWork2 {
    //求1！+2！+3！+4！+........+n!的和
    public static int factoRial(int n){
        int tot = 1;
        for(int i=1;i<=n;i++){
            tot*=i;
        }
        return tot;
    }
    public static void main(String[] args){
        Scanner input = new Scanner(System.in);
        int n ;
        while(input.hasNextInt()){
            n=input.nextInt();
            int tot = 0;
            for(int i=1;i<=n;i++){
                tot+=factoRial(i);
            }
            System.out.println("1到"+n+"的阶乘和是"+tot);
        }
    }
}
